﻿<Window x:Class="Lithnet.Acma.Presentation.MissingAttributeWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation"
        xmlns:t="clr-namespace:Lithnet.Acma;assembly=Lithnet.Acma"
        xmlns:p="clr-namespace:Lithnet.Acma.Presentation"
        Title="{Binding DisplayName}"
        Height="250"
        Width="375"
        ResizeMode="CanResize"
        ShowInTaskbar="False"
        Topmost="True"
        WindowStartupLocation="CenterOwner"
        Icon="{Binding DisplayIcon}">

    <StackPanel>
        <Grid HorizontalAlignment="Left"
              Width="368">

            <Grid.ColumnDefinitions>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.Margin>
                        <Thickness>15</Thickness>
                    </Grid.Margin>

                    <TextBlock Grid.Row="0"
                               Grid.ColumnSpan="2"
                               TextWrapping="Wrap"
                               Margin="5"
                               Text="The attribute listed below was not found in the database. Please select an attribute to replace the specified attribute" />

                    <Label Content="Missing attribute name"
                           Grid.Row="1"
                           Grid.Column="0" />
                    <TextBox Text="{Binding Path=MissingAttributeName, Mode=OneWay}"
                             Grid.Row="1"
                             Margin="2"
                             Grid.Column="1"
                             IsReadOnly="true"/>

                    <Label Content="Replacement attribute"
                           Grid.Row="2"
                           Grid.Column="0" />
                    <ComboBox ItemsSource="{Binding Path=AllowedAttributes}"
                              SelectedItem="{Binding Path=Attribute, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                              DisplayMemberPath="Name"
                              Margin="2"
                              Grid.Row="2"
                              Grid.Column="1" />
                </Grid>
            </StackPanel>

            <StackPanel Grid.Row="1"
                        Orientation="Horizontal"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Bottom">
                <Button Content="OK"
                        MinWidth="50"
                        MinHeight="27"
                        Margin="5"
                        Command="{Binding Commands.Create}"
                        IsDefault="True" />
                <Button Content="Cancel"
                        Margin="5"
                        MinWidth="50"
                        MinHeight="27"
                        IsCancel="True" />
            </StackPanel>
        </Grid>
    </StackPanel>
</Window>
